/**
 * Created by Administrator on 2017/7/11.
 */
;(function()
{
    'use strict';

    angular.module('xiaohu', ['ui.router'])
        .config(function($interpolateProvider,
                         $stateProvider,
                         $urlRouterProvider)
        {
            $interpolateProvider.startSymbol('[:');
            $interpolateProvider.endSymbol(':]');

            $urlRouterProvider.otherwise('/home');

            $stateProvider
                .state('home', {
                    url: '/home',
                    templateUrl : 'home.tpl'
                })
                .state('signup', {
                    url: '/signup',
                    templateUrl : 'signup.tpl'
                })
                .state('login', {
                    url: '/login',
                    templateUrl : 'login.tpl'
                })
        })

        .service('UserService', [
            function() {
                var me = this;
                me.signup_data = {};
                me.signup = function () {
                    console.log('signup');
                }
        }])

        .controller('SignupController', [
            '$scope',
            'UserService',
            function($scope, UserService)
            {
                $scope.User = UserService;
        }])

        .controller('loginController', [
            '$scope',
            'UserService',
            function ($scope, UserService) {
                $scope.User = UserService;
            }
        ])

})();
